<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=750,user-scalable=0"/>
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>专业搬家</title>
    <link rel="stylesheet" href="__PUBLIC__/css/weui.css?t=2014102898918">
    <link rel="stylesheet" href="__PUBLIC__/css/jquery-weui.min.css?t=2014102898918">   

    <style>
        .main {
             font-size: 42px;
   margin: 50% auto;
}


        .upload_btn_confirm{
    border-radius: 10px;
    height: 74px;
    width: 80%;
    padding-left: 20%;
    background-color: #26adec;
    color: #ffffff;
    font-size: 42px;
    border: 0;
    outline: 0;
   
}



    </style> 
</head>

<body>
<div class="main">
        <!-- <div class="confirm-order"  style=" position: absolute; bottom: 0; left:0;"> -->
            <label>请选择一个图像文件：</label>  
    <input name="upphoto" id="upOtherCard" value="" type="file" multiple  class="upload_btn_confirm">
            
        </div>
        <div style="width:100%; margin:12px 0  32px;" id="renzhen_imgio">
                <volist name="otherimages" id="vo" key='num'>
                    <div id="otcert_{$num}"  style="display:inline-block; width:200px; height:200px; font-size: 16px; text-align:center;"><a href="__ROOT__/Uploads/{$vo.savepath}{$vo.savename}" target="_blank"><img src="__ROOT__/Uploads{$vo.savepath}{$vo.savename}" style="display:block; padding:5px;" class="imgshowaop" height="200px" width="200"></a> <a href="javascript:;" style="font-size: 45px;" onclick="deleteotherpic('{$num}')">×</a>
                    </div>
                </volist>
                </div>
    
</body>
    <script src="__PUBLIC__/js/jquery.min.js?t=2014102898918"></script>
    <script src="__PUBLIC__/js/jquery-weui.min.js?t=2014102898918"></script>
    <script src="__PUBLIC__/layer/layer.js"></script>
    <script>
     $("#upOtherCard").change(function(){
        //创建FormData对象
        var data = new FormData();
        //为FormData对象添加数据
        $.each($('#upOtherCard')[0].files, function(i, file) {
            data.append(i, file);
        });
        //发送数据
        $.ajax({
            url:"__MODULE__/Upload/upOtherCard",
            type:'POST',
            data:data,
            cache: false,
            contentType: false,     //不可缺参数
            processData: false,     //不可缺参数
            success:function(data){
       
             var obj = eval("("+data+")"); 

             t=$('#renzhen_imgio');
                
                for(i=0;i<obj.length;i++){

                var s=obj[i].savepath+obj[i].savename;

                var q='<div id="otcert_'+ i +'" class="po-re piCLif otcertcount" style="display:inline-block; width:200px;height:200px; text-align:center;"><img src="__ROOT__/Uploads'+ s+'"  width="200" height="200px" style="display:block; padding:5px;" class="imgshowaop"/></div><a href="javascript:;" style="font-size: 45px;" onclick="deleteotherpic('+ i +')">×</a>';
                
                t.append(q);
            }




            });

       
               
    },
            error:function(){
               msg = '上传出错';
                layer.alert(msg);
            }
        });
    });

     function deleteotherpic(id){
        $.post('__MODULE__/Upload/deleteCertificates',{imgid:id},function(resp){
         
                $("#otcert_"+id).remove();
            
        });
    }
     function gosecond() {
                location.href='__CONTROLLER__/uploadpic/id'+;
            }

    </script>

</html>
